package com.cms.bind_api

import android.app.Activity
import android.util.Log

object ButterKnife {
    private var parameterName = "Parameter"
    private var method ="Method"
    fun bind(activity: Activity) {

        val name = activity.javaClass.simpleName
        try {

            val forName = Class.forName("com.cms.processor.$name$parameterName")

            Log.i("TAG----W", "bind: " + forName)
            val newInstance = forName.newInstance()
            val viewGet = newInstance as ViewGet
            viewGet.getView(activity)
            val forName1 = Class.forName("com.cms.processor.$name$method")
            Log.i("TAG----2", "bind: " + forName1)
            val method = (forName1.newInstance()) as InvokeMethod
            method.invoke(activity)


        } catch (e: Exception) {
            Log.i("TAG----", "bind: " + e.toString())
        }

    }
}